/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * VentanaPrincipal.java
 *
 * Created on 11/03/2012, 03:57:10 PM
 */
package com.torresquintero.oncologos.common.vista;

import com.torresquintero.oncologos.common.factory.LogginManager;
import com.torresquintero.oncologos.medico.vista.PanelAgenda;
import com.torresquintero.oncologos.medico.vista.PanelBuscarCitas;
import com.torresquintero.oncologos.quimioterapia.vista.PanelInventario;
import com.torresquintero.oncologos.secretaria.vista.PanelAsignarCita;
import com.torresquintero.oncologos.secretaria.vista.PanelCrearPaciente;

/**
 *
 * @author Camilo Andres
 */
public class VentanaPrincipal extends javax.swing.JFrame {

    /** Creates new form VentanaPrincipal */
    public VentanaPrincipal() {
        initComponents();
        
        /*mnuCitas.setNombreComponente("vistaprincipal.menuCitas");
        mnuHistoriaClinica.setNombreComponente("vistaprincipal.menuHistoriaClinica");
        mnuItemBuscarCitas.setNombreComponente("vistaprincipal.mnuItemBuscarCitas");
        mnuItemCrearHistoria.setNombreComponente("vistaprincipal.mnuItemCrearHistoria");
        mnuItemVerHistoria.setNombreComponente("vistaprincipal.mnuItemVerHistoria");
        mnuKardex.setNombreComponente("vistaprincipal.mnuKardex");
        mnuMedico.setNombreComponente("vistaprincipal.mnuMedico");
        mnuVerAgenda.setNombreComponente("vistaprincipal.mnuVerAgenda");*/
        setTitle("Uds esta identificado como:"+LogginManager.getFuncionarioLogedIn().toString());

    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        dpPanel = new javax.swing.JDesktopPane();
        jToolBar1 = new javax.swing.JToolBar();
        mnuBarOncologos = new javax.swing.JMenuBar();
        mnuMedico = new javax.swing.JMenu();
        mnuVerAgenda = new javax.swing.JMenuItem();
        mnuKardex = new MenuItemOncologos();
        mnuHistoriaClinica = new javax.swing.JMenu();
        mnuItemCrearHistoria = new javax.swing.JMenuItem();
        mnuItemVerHistoria = new javax.swing.JMenuItem();
        mnuCitas = new javax.swing.JMenu();
        mnuItemBuscarCitas = new javax.swing.JMenuItem();
        jMenu1 = new javax.swing.JMenu();
        mnuItemAsignarCita = new javax.swing.JMenuItem();
        mnuInventario = new javax.swing.JMenuItem();
        jMenu2 = new javax.swing.JMenu();
        jMenuItem1 = new javax.swing.JMenuItem();
        jMenuItem2 = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jToolBar1.setRollover(true);

        mnuMedico.setText("Medico");

        mnuVerAgenda.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_A, java.awt.event.InputEvent.SHIFT_MASK | java.awt.event.InputEvent.CTRL_MASK));
        mnuVerAgenda.setText("Ver Agenda");
        mnuVerAgenda.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mnuVerAgendaActionPerformed(evt);
            }
        });
        mnuMedico.add(mnuVerAgenda);

        mnuKardex.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_K, java.awt.event.InputEvent.SHIFT_MASK | java.awt.event.InputEvent.CTRL_MASK));
        mnuKardex.setText("Ver Kardex");
        mnuMedico.add(mnuKardex);

        mnuHistoriaClinica.setText("Historia Clinica");

        mnuItemCrearHistoria.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_C, java.awt.event.InputEvent.SHIFT_MASK | java.awt.event.InputEvent.CTRL_MASK));
        mnuItemCrearHistoria.setText("Crear Historia");
        mnuHistoriaClinica.add(mnuItemCrearHistoria);

        mnuItemVerHistoria.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_H, java.awt.event.InputEvent.SHIFT_MASK | java.awt.event.InputEvent.CTRL_MASK));
        mnuItemVerHistoria.setText("Ver Historia");
        mnuHistoriaClinica.add(mnuItemVerHistoria);

        mnuMedico.add(mnuHistoriaClinica);

        mnuCitas.setText("Citas");

        mnuItemBuscarCitas.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_B, java.awt.event.InputEvent.SHIFT_MASK | java.awt.event.InputEvent.CTRL_MASK));
        mnuItemBuscarCitas.setText("Buscar Citas");
        mnuItemBuscarCitas.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mnuItemBuscarCitasActionPerformed(evt);
            }
        });
        mnuCitas.add(mnuItemBuscarCitas);

        mnuMedico.add(mnuCitas);

        mnuBarOncologos.add(mnuMedico);

        jMenu1.setText("Secretaria");

        mnuItemAsignarCita.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_A, java.awt.event.InputEvent.CTRL_MASK));
        mnuItemAsignarCita.setText("Asignar Cita");
        mnuItemAsignarCita.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mnuItemAsignarCitaActionPerformed(evt);
            }
        });
        jMenu1.add(mnuItemAsignarCita);

        mnuInventario.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_I, java.awt.event.InputEvent.CTRL_MASK));
        mnuInventario.setText("Inventario");
        mnuInventario.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mnuInventarioActionPerformed(evt);
            }
        });
        jMenu1.add(mnuInventario);

        jMenu2.setText("Paciente");

        jMenuItem1.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_P, java.awt.event.InputEvent.CTRL_MASK));
        jMenuItem1.setText("Crear,Buscar, Editar");
        jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem1ActionPerformed(evt);
            }
        });
        jMenu2.add(jMenuItem1);

        jMenuItem2.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_D, java.awt.event.InputEvent.CTRL_MASK));
        jMenuItem2.setText("Directorio");
        jMenu2.add(jMenuItem2);

        jMenu1.add(jMenu2);

        mnuBarOncologos.add(jMenu1);

        setJMenuBar(mnuBarOncologos);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(dpPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 412, Short.MAX_VALUE)
            .addComponent(jToolBar1, javax.swing.GroupLayout.DEFAULT_SIZE, 412, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jToolBar1, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(dpPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 251, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void mnuVerAgendaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnuVerAgendaActionPerformed
        // TODO add your handling code here:
        agregarVentana(new PanelAgenda());
    }//GEN-LAST:event_mnuVerAgendaActionPerformed

    private void mnuItemAsignarCitaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnuItemAsignarCitaActionPerformed
        // TODO add your handling code here:
        agregarVentana(new PanelAsignarCita());
    }//GEN-LAST:event_mnuItemAsignarCitaActionPerformed

    private void mnuInventarioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnuInventarioActionPerformed
        // TODO add your handling code here:
        agregarVentana(new PanelInventario());
    }//GEN-LAST:event_mnuInventarioActionPerformed

    private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem1ActionPerformed
        // TODO add your handling code here:
        agregarVentana(new PanelCrearPaciente());
    }//GEN-LAST:event_jMenuItem1ActionPerformed

    private void mnuItemBuscarCitasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnuItemBuscarCitasActionPerformed
        // TODO add your handling code here:
        agregarVentana(new PanelBuscarCitas());
    }//GEN-LAST:event_mnuItemBuscarCitasActionPerformed
    /**
     * @todo
     * @param panel 
     */
   public void agregarVentana(PanelOncologos panel){
       InternalFrame vent=new InternalFrame(panel);
       dpPanel.add(vent);
   }
    
    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new VentanaPrincipal().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JDesktopPane dpPanel;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JMenuItem jMenuItem2;
    private javax.swing.JToolBar jToolBar1;
    private javax.swing.JMenuBar mnuBarOncologos;
    private javax.swing.JMenu mnuCitas;
    private javax.swing.JMenu mnuHistoriaClinica;
    private javax.swing.JMenuItem mnuInventario;
    private javax.swing.JMenuItem mnuItemAsignarCita;
    private javax.swing.JMenuItem mnuItemBuscarCitas;
    private javax.swing.JMenuItem mnuItemCrearHistoria;
    private javax.swing.JMenuItem mnuItemVerHistoria;
    private javax.swing.JMenuItem mnuKardex;
    private javax.swing.JMenu mnuMedico;
    private javax.swing.JMenuItem mnuVerAgenda;
    // End of variables declaration//GEN-END:variables
}
